import { defineConfig } from 'vitepress'

import path from 'node:path'
// https://vitepress.dev/reference/site-config
export default defineConfig({
  base: '/foff-ui/', // 打包配置nginx需要
  lang: 'zh',
  title: "FOFF UI",
  description: "A VitePress Site",
  cleanUrls: true, // 去除路由末尾的 "/"
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: 'Home', link: '/' },
      { text: 'guide', link: '/quick-start' }
    ],

    sidebar: [
      {
        text: '指南',
        items: [
          { text: 'quick start', link: '/quick-start' },
          { text: 'todo list', link: '/todo-list' },
        ]
      },
      {
        text: '基础',
        items: [
          { text: 'button', link: '/components/button' },
          { text: 'link', link: '/components/link' }
        ]
      },
      {
        text: '数据展示',
        items: [
          { text: 'avatar', link: '/components/avatar' }
        ]
      }
    ],

    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
    ]
  },
  vite: {
    resolve: {
      alias: {
        '@components': path.resolve(__dirname, '../components')
      }
    },
    ssr: {
      noExternal: ['@highlightjs/vue-plugin']
    },
    optimizeDeps: {
      include: ['@highlightjs/vue-plugin']
    }
  }
})
